#要想请求成功登录接口，需要先拿到登录验证码接口的cookie，然后给登录接口使用即可
#导包
import requests
#发送接口请求
#发送验证码接口
resp_v = requests.get(url="http://127.0.0.1/index.php?m=Home&c=User&a=verify&r=0.8475888637273358 ")
my_cookie = resp_v.cookies
#发送登录接口
resp_login = requests.post(url='http://127.0.0.1/index.php?m=Home&c=User&a=do_login&t=0.999687125390627',
                         headers={"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"},
                         data={"username": "13800000000", "password": "123456", "verify_code": "8888"},
                        cookies=my_cookie)
#查看响应数据
print(resp_login.json())